package com.zysstudy.web.controller;

/**
 * @author zhaoyoushui
 * @date 2025/8/1 11:30
 * @Description
 * @Copyright 南京优通信息科技股份有限公司
 */

import com.zysstudy.web.domain.model.User;
import com.zysstudy.web.lock.annotation.RequestLock;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @PostMapping("/addUser1")
    public String addUser1(@RequestBody User user) {
        System.out.println("不做任何处理" + user);
        return "添加成功";
    }

    @PostMapping("/addUser2")
    @RequestLock(prefix = "addUser")
    public String addUser2(@RequestBody User user) {
        System.out.println("防重提交" + user);
        return "添加成功";
    }
}
